package JDBC;
import java.sql.ResultSet;
import java.sql.SQLException;


public class LogeoJDBC {
	
	public static Integer comprobarlogeo(String user,String pass) throws SQLException {
		Integer id = 0;
		conexion.con();
		ResultSet c = conexion
				.crearconsulta("Select * from acceso where usuario='"
						+ user +"' AND contrasenya='"+pass+ "';");
		if (c.next()) {
			id=c.getInt("id_persona");
		}

		return id;
	}

}
